package com.lj.infoisland.domain.po;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

/**
 * 用户类
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@TableName(value = "users")
public class Users implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.ASSIGN_ID)

    /*
     * id
     */
    private Long id;

    /**
     * 用户唯一id
     */
    @TableField(value = "user_unique_id", fill = FieldFill.INSERT)
    private String userUniqueId;

    /*
     * 用户名
     */
    @TableField(value = "username")
    private String username;

    /**
     * 密码
     */
    @TableField(value = "password")
    private String password;

    /**
     * 电子邮件
     */
    @TableField(value = "email")
    private String email;

    /**
     * 全名
     */
    @TableField(value = "full_name")
    private String fullName;

    /**
     * 性别
     */
    @TableField(value = "sex")
    private Integer sex;

    /**
     * 电话号码
     */
    @TableField(value = "phone_number")
    private String phoneNumber;

    /**
     * 地址
     */
    @TableField(value = "address")
    private String address;

    /**
     * 头像url
     */
    @TableField(value = "avatar_url")
    private String avatarUrl;

    /**
     * 描述
     */
    @TableField(value = "description")
    private String description;

    /**
     * 点赞数
     */
    @TableField(value = "like_num")
    private Integer likeNum;

    /**
     * 收藏数
     */
    @TableField(value = "favorite_num")
    private Integer favoriteNum;

    @TableField(value = "ip")
    private String ip;

    /**
     * 用户角色: admin, user
     */
    @TableField(value = "role")
    private String role;

    /**
     * 用户状态: 0: 禁用, 1: 启用
     */
    @TableField(value = "status")
    private Integer status;

    /**
     * 创建时间
     */
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date createdAt;

    /**
     * 更新时间
     */
    @TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date updatedAt;

    /**
     * 生日
     */
    @TableField(value = "birthday")
    private Date birthday;

    /**
     * 年龄
     */
    @TableField(value = "age")
    private Integer age;

    @TableField(value = "interests")
    private String interests;

    /**
     * 是否初始化标签
     */
    @TableField(value = "is_init")
    private Integer isInit;
}